home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / grepfv10.zip / GREPFV10.TXT < prev   
Text File  |  1994-03-16  |  7KB  |  235 lines

  1. GREPFV version 10 by Nigel Salt (c) 15 March 1994
  2. ====================================================
  3.  
  4. Description
  5. ===========
  6.  
  7. GREPFV is a text string searching utility with a difference. It
  8. searches for regular expressions in text files, archived files,
  9. and executable files. It will automatically unarchive ZIP, PAK,
  10. ZOO, LZH, ARJ and ARC files providing that you have a copy of
  11. FV.COM and the necessary archive managers in your path.
  12.  
  13. Encrypted archives are not supported. The output from grepfv will
  14. be a FAILED line for each encrypted file in an archive.
  15.  
  16. FV.COM is Vernon Buerg's addon for LIST. It is available on most
  17. BBSs and several internet sites. More recent versions have been
  18. distributed in the list archive. The latest version of list that
  19. I have seen at the time of writing is in list90.zip or
  20. list90.exe. The latter is a self extracting version.
  21.  
  22. The archivers required are
  23. ARC       arc.exe (A copy of pak.exe renamed to arc.exe will do)
  24. ZOO       zoo.exe
  25. LZH       lharc.exe
  26. PAK       pak.exe
  27. ZIP       pkunzip.exe
  28. ARJ       arj.exe
  29.  
  30. The syntax for grepfv is
  31.  
  32. grepfv [@optfile] [options] "regexp" filepattern[+] [tempdir]
  33.  
  34. Parameters in [] are optional
  35.  
  36. where
  37.  
  38. @optfile
  39.        reads parameters from optfile
  40.        THIS MUST BE THE FIRST OPTION
  41.  
  42. OPTIONS
  43.  
  44. -o     outfile
  45.        outputs the results to 'outfile' as well as the screen
  46.  
  47. -x     REGEXP
  48.  
  49.        excludes all files whose name match 'REGEXP'. This will
  50.        affect files in archives too.
  51.  
  52.        -x "*\.com"
  53.  
  54.        would exclude all all files with .COM in their names.
  55.  
  56.        You may have as many -x options as memory allows.
  57.        THE & AND | REGEXP OPTIONS ARE NOT SUPPORTED
  58.  
  59. -i     REGEXP
  60.  
  61.        includes only files whose name matches 'REGEXP'. This will
  62.        affect files in archives too.
  63.  
  64.        -i "*\.txt"
  65.  
  66.        would include only files with .COM in their names.
  67.  
  68.        You may have as many -i options as memory allows.
  69.        THE & AND | REGEXP OPTIONS ARE NOT SUPPORTED
  70.  
  71. REGEXP is a pattern made up of ASCII characters plus the
  72. following special "wild cards". Enclose the pattern in quotes to
  73. avoid DOS misunderstanding the special characters. Searching for
  74. a backslash poses particular problems because DOS treats it as an
  75. escape character. To look for a backslash you actually have to
  76. specify "\\\\" as the pattern. DOS then translates this to "\\"
  77. which causes grepfv to look for a literal backslash.
  78.  
  79. All searches are case insensitive so "nIgel", "NIGEL", and
  80. "Nigel" all match the expression "nigel".
  81.  
  82. REGULAR EXPRESSIONS:
  83.  
  84. \     treat next char as literal
  85. .     match any single character
  86. *     match 0 or more characters
  87. &     preceeding expression AND following expression
  88. |     preceeding expression OR following expression
  89.  
  90. FILEPATTERN is a dos type file specification including wildcards.
  91. If you want to search all of the files in a directory then end
  92. the filepattern with a \. If you want to search all of the files
  93. in subdirectories too then add a + to the end of the filepattern.
  94. For example "\ns\" searches all files in the \ns directory,
  95. "\ns\nigel.*" searches all files in the \ns directory that are
  96. called nigel, "\ns\nigel.*+" searches all files called nigel in
  97. the \ns directory and all of its subdirectories.
  98.  
  99. If an archive matches the FILEPATTERN then all files in the
  100. archive will be searched unless one of the exclude options
  101. eliminates them.
  102.  
  103. TEMPDIR should preferably be a RAM disc. It is the location that
  104. grepfv will use to temporarily explode the files in the archives
  105. which it searches. The temporary directory must be on a drive
  106. with enough free space to hold the largest file in the archive.
  107.  
  108. Examples
  109. ========
  110.  
  111. 1. grepfv "vga" tools.zip f:
  112.  
  113. Searches all of the files in tools.zip for vga and uses drive f
  114. for temporary files
  115.  
  116. 2. grepfv "cga|vga" \tools\
  117.  
  118. Searches all files in the directory \tools of the current drive
  119. for cga or vga using the current drive for temporary files
  120. because no alternative was specified. Note the trailing backslash
  121. on tools; without it grepfv would look for a file called tools in
  122. the root directory.
  123.  
  124. 3. grepfv "cga&vga" \tools\+
  125.  
  126. Searches all of the files in tools and its subdirectories for
  127. line which contain both the word cga and vga.
  128.  
  129. 4. grepfv -x "\.COM" -x "\.EXE" "nigel" *.*>c:\ns\grep.out
  130.  
  131. Searches all files in the current directory for the string
  132. "nigel" except those files with .COM or .EXE in the file name.
  133. The output is redirected to the file c:\ns\grep.out.
  134.  
  135. You can see the results on the screen and save them to a file
  136. using the -o option like this:
  137.   grepfv -o grep.out -x "\.COM" -x "\.EXE" "nigel" *.*
  138.  
  139. DO NOT REDIRECT TO AN OUTPUT FILE THAT COULD BE INCLUDED IN THE
  140. SEARCH. IF YOU DO THEN GREPFV WILL BEGIN SEARCHING ITS OWN
  141. RESULTS AND THE OUTCOME WILL BE INDETERMINATE.
  142.  
  143.  
  144. 5. grepfv "nigel" n*.*|more
  145.  
  146. Searches all files beginning with n in the current directory for
  147. the string "nigel" and presents the result one screen at a time
  148. by piping the output to the DOS more program.
  149.  
  150. 6. grepfv -i "gr*\.txt" -i "zip" "nigel" *.zip
  151.  
  152. Searches all ZIP archives in the current directory. Only archived
  153. files whose names begin with "gr" and end ".txt" will be searched
  154. for "nigel". All other files will be excluded. Note the need for
  155. the second -i option. Without -i "zip" all of the archives would
  156. be excluded too!
  157.  
  158. 7. grepfv @grep.opt myexp myfile.*
  159.  
  160. Reads the options from grep.opt and then adds the remaining
  161. command line parameters. If you have a standard search that you
  162. perform regularly then the whole command line can be held in a
  163. file then the grepfv call is simply
  164. grepfv @optionfilename
  165.  
  166.  
  167. History
  168. =======
  169.  
  170. Grepfv10 fixed the following:
  171.  
  172. -  Introduced the -o output file feature
  173. -  Introduced the @file feature to read options from a file
  174.  
  175. Grepfv9 fixed the following:
  176.  
  177. -  Introduced -i include files option
  178. -  -x and -i now take a wild card expression
  179.  
  180. Grepfv8 fixed the following:
  181.  
  182. -  Frees some stack for FV.COM
  183. -  Introduced -x exclude option
  184. -  Throws a line after failure reports
  185. -  Indents found text by two characters for ease of reading
  186. -  Prints a summary of activity at the end of processing
  187. -  Avoids crashing with zips that contain files whose names
  188.    begin with -
  189. -  Prints options at the start of processing
  190.  
  191. Grepfv7 fixed the following:
  192.  
  193. -  Support for ARJ archives
  194. -  New source supplied
  195.  
  196. Grepfv6 fixed the following:
  197.  
  198. -  Password protected archives cause a failure report but do not
  199.    abort processing
  200. -  Archives with stored subdirectories are handled correctly
  201. -  New source included
  202.  
  203. Grepfv5 fixed the following :
  204.  
  205. -  Source code included for the first time
  206. -  Stack size increased to avoid overflow
  207. -  grepfv4 did not handle PKZip version 2.04 correctly
  208. -  my email address was wrong in the docs (sorry)
  209.  
  210.  
  211.  
  212. ---------
  213. Copyright
  214. ---------
  215.  
  216. grepfv  may be distributed freely as long as this document
  217. is left unchanged. Indeed I would be grateful if you would
  218. distribute it to any sites where it is not available.
  219.  
  220. If you keep it you should register it by sending a donation of
  221. not less than 10 UK pounds cash (in any currency) to me.
  222.  
  223. Nigel Salt
  224. 25 Lower Station Rd
  225. Crayford
  226. Kent
  227. DA1 3PY
  228. UK
  229.  
  230. Phone +44 322 553260
  231.  
  232. Internet nao@cix.compulink.co.uk
  233.  
  234.  
  235.